package com.jason.service;

import com.jason.mail.MailSender;
import com.jason.mail.MailSenderInfo;
import org.springframework.stereotype.Service;

@Service
public class EmailService {

    public void sendEmail(String target, String subject, String content) {
        String[] targets = {target};
        MailSenderInfo mailSenderInfo = new MailSenderInfo(targets, subject, content, null);
        Thread thread = new Thread(() -> {
            boolean b = MailSender.sendMail(mailSenderInfo);
            System.out.println(target + "邮件发送成功:" + b);
        });
        thread.start();
    }
}
